#include <QQuickView>
#include <QQmlEngine>
#include <QQmlContext>
#include <QGuiApplication>
#include <QDebug>
#include "Frameless/TaoFrameLessView.h"

int main(int argc, char **argv)
{
    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

    QGuiApplication app(argc, argv);
    TaoFrameLessView view;

    QString strAppPath = app.applicationDirPath();
    QString strProjectShowPath = ProjectShowPath;
    QString strQmlPath = strProjectShowPath + "Qml/";
    QString strImgPath	= strProjectShowPath + "Image/";

    view.setMinimumSize({600, 400});
    view.resize(800, 600);
    view.engine()->addImportPath(strQmlPath);
    view.engine()->addImportPath(TaoQuickImportPath);

    view.rootContext()->setContextProperty("projectShowPath", ProjectShowPath);
    view.rootContext()->setContextProperty("taoQuickImportPath", TaoQuickImportPath);
    view.rootContext()->setContextProperty("appPath", strAppPath);
    view.rootContext()->setContextProperty("imgPath", strImgPath);

    const QUrl mainUrl = strQmlPath + QStringLiteral("main.qml");
    view.setSource(mainUrl);
    view.moveToScreenCenter();
    view.show();

    return app.exec();
}
